@extends('admin.master')
<script src="/js/admin/chargeRecords.js"></script>
@section('title', '充值管理')
	
@section('firstItem')
@parent
    <span class="firstItem">充值管理</span>
    <input class="a_indexbg" type="hidden" value="chargerecords" />
@stop
@section('searchList')
@parent
<a class="queryBoxBtn">搜索</a>
<div>
	<input class="chargeQueryInput" type="text" placeholder="输入用户名或设备编号" value="{{ $condition }}" />
</div>
@stop
@section('dataTables')
@parent
<table class="installInfo dataTables" cellspacing="0" cellpadding="0">
	<thead>
		<tr>
			<td>序号</td>
			<td>设备编号</td>
			<td>用户名</td>
			<td>剩余流量</td>
			<td>购买金额</td>
			<td>购买流量数</td>
			<td>购买人</td>
			<td>后台充值人</td>
			<td>撤销流量数</td>
			<td>撤销操作人</td>
			<td>备注信息</td>
			<td>时间</td>
			
			<td>购买记录</td>
			<td>流量充值</td>
		</tr>
	</thead>
	<tbody>
		@for($i=0, $chargeRecordCount=count($charge_records); $i<$chargeRecordCount; $i++)
		<tr >
			<td>{{ $i+1 }}</td>
			<td class="DeviceCodeCell devicecodeVal">{{ $charge_records[$i]->device->code }}</td>
			<td class="userNameCell">{{ $charge_records[$i]->device->installInfo->customer_name or '' }}</td>
			<td class="FluxCell">{{ $charge_records[$i]->residual_flow }}L</td>
			<td>{{ $charge_records[$i]->money or 0 }}元</td>
			<td>{{ $charge_records[$i]->flow }}L</td>
			<td>{{ $charge_records[$i]->userInfo->name or '' }}</td>
			<td>{{ $charge_records[$i]->adminInfo->name or '' }}</td>
			<td>{{ is_null($charge_records[$i]->discharge_flow)? '': $charge_records[$i]->discharge_flow.'L'}}</td>
			<td>{{ $charge_records[$i]->dischargeAdmin->name or '' }}</td>
			<td class="chargeAddTextCell" style="width:200px;">{{ $charge_records[$i]->remark }}</td>
			<td>{{ $charge_records[$i]->created_at }}</td>
			
			<td><a href="/admin/device/chargeRecords/history?device_id={{ $charge_records[$i]->device_id }}">查看</a></td>
			<td><a class="rechargeBtn">充值</a><input class="addresInput" type="hidden" value="" /><input class="userListInput" type="hidden" value="" /><input class="device_id" type="hidden" value="{{ $charge_records[$i]->device_id }}" /></td>
		</tr>
		@endfor
	</tbody>
</table>
@stop
@section('page_num')
@if(!is_null($charge_records->first()))
	{!! $charge_records->appends(['device_id' => $charge_records->first()->device_id])->render() !!}
@endif

@stop
@section('infor_promit')
@parent
	<!-- 充值编辑框 -->
	<div class="payFluxBg payFluxManageBg">
		<div class="payFlux payFluxManage" >
			<p class="titleTxt">充值流量</p>
			<div class="displayBox p_relative">
				<div>
					<p><span>设备编码:</span><label class="chargeDeviceCode"></label></p>
					<p><span>剩余流量:</span><label class="chargeResidueFlux"></label></p>
				</div>
				<div >
					<p><span>用户名:</span><label class="chargeGetUserName" style="width: 200px;display: block;float: right;"></label></p>
					<p><span>安装地址:</span><label class="chargeGetAddress" style="width: 200px;display: block;float: right;"></label></p>
				</div>
				<span class="textareaTitle" style="top:100px;">备注信息：</span>
				<textarea class="textareaBox charggeRecord_AddText"></textarea>
				<div class="payBox">充值流量(L)<input class="chargeFluxBox" type="text" value="" placeholder="请填整数" /></div>
				<label class="labelBox" id="chargeLabel"></label>
			<div class="btnBox" >
				<a class="cancelBtn chargeCancelBtn">取消</a>
				<a class="okBtn chargeOkBtn">确定</a>
			</div>
		</div>
	</div>

@stop
